<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div style="display: none"><script id="myEditorImage" type="text/plain"></script></div> 
<div class="pageContent">
	<form id="mainFormId" method="post" action="${rootUrl}/order/comments/${comments.id}" class="pageForm required-validate" onsubmit="return validateCallback(this, editDialogAjaxDone);">
	<input type="hidden" name="_method" value="put">
		<div class="pageFormContent" layoutH="56">
		<%-- <input type="hidden" name="goodsClassParentId" value="${goodsClassParentId }"> --%>
			<input type="hidden" name="comments.id" value="${comments.id }">
			<input type="hidden" name="comments.goodsOrder.id" value="${comments.goodsOrder.id }">
			<p>
				<label>会员名：</label>
				<input readonly="readonly" type="text" value="${comments.member.name }"/>
				<a class="buttonActive" href="${rootUrl}/member/member!detail?id=${comments.member.id}" title="会员详情" buttonActiverel="member_detail_orders" rel="member_detail" target="dialog" width="800" height="600"><span>会员详情</span></a>
			</p>
			<p>
				<label>商品名：</label>
				<input readonly="readonly" type="text" size="30" value="${comments.goodsName }"/><br>
			</p>
			<p>
				<label>商品规格：</label>
				<input readonly="readonly" type="text" size="30" value="${comments.goodsSpec }"/><br>
			</p>
			<p>
				<label>商品价格：</label>
				<input readonly="readonly" type="text" size="30" value="<fmt:formatNumber value='${comments.goodsPrice/100}' pattern='0.00'/>"/><br>
			</p>
			<p>
				<label>商品数量：</label>
				<input readonly="readonly" type="text" size="30" value="${comments.goodsNum }"/><br>
			</p>
			<p>
				<label>评分：</label>
				<input readonly="readonly" type="text" size="30" value="${comments.scores }"/><br>
			</p>
			<p>
				<label>评价时间：</label>
				<input readonly="readonly" type="text" size="30" value="<fmt:formatDate value='${comments.addtime }' pattern='yyyy-MM-dd HH:mm:ss'/>"/><br>
			</p>
			<p>
				<label>评价状态：</label>
				<input name="comments.state" id="statValueId" readonly="readonly" type="hidden" size="30" value="${comments.state}"/>				
				<input readonly="readonly" id="statTxtId" type="text" size="30" value="<c:if test="${comments.state ==0}">待审核</c:if><c:if test="${comments.state ==1}">审核通过</c:if><c:if test="${comments.state ==2}">审核不通过</c:if>"/><br>
			</p>
			<p>
				<label>评价处理备注：</label>
				<input name="comments.remark" <c:if test="${comments.state != 0}">readonly="readonly"</c:if> type="text" size="30" value="${comments.remark }"/><br>
			</p>
			<dl class="nowrap">
				<dt>评价内容：</dt>
				<dd><textarea cols="150" readonly="readonly" rows="5">${comments.content}</textarea></dd>
			</dl>
			<dl class="nowrap">
				<dt>评价回复：</dt>
				<dd><textarea name="comments.reply" cols="150" <c:if test="${comments.state != 0}">readonly="readonly"</c:if> rows="5">${comments.reply}</textarea></dd>
			</dl>
	        <dl class="nowrap">
				<dt>评价图片：</dt>
				<dd style="width: 800px;">
				<c:if test="${comments.image != null && comments.image != ''}">
					<div class="imgContainer" style="float:left;margin:10px;">
						<a target="_blank" href="${comments.image}"><img src="${comments.image}" /></a>
					</div>
				</c:if>
				<c:if test="${comments.image2 != null && comments.image2 != ''}">
					<div class="imgContainer" style="float:left;margin:10px;">
						<a target="_blank" href="${comments.image2}"><img src="${comments.image2}" /></a>
					</div>
				</c:if>
				<c:if test="${comments.image3 != null && comments.image3 != ''}">
					<div class="imgContainer" style="float:left;margin:10px;">
						<a target="_blank" href="${comments.image3}"><img src="${comments.image3}" /></a>
					</div>
				</c:if>
				<c:if test="${comments.image4 != null && comments.image4 != ''}">
					<div class="imgContainer" style="float:left;margin:10px;">
						<a target="_blank" href="${comments.image4}"><img src="${comments.image4}" /></a>
					</div>
				</c:if>
				<c:if test="${comments.image5 != null && comments.image5 != ''}">
					<div class="imgContainer" style="float:left;margin:10px;">
						<a target="_blank" href="${comments.image5}"><img src="${comments.image5}" /></a>
					</div>
				</c:if>
				</dd>
			</dl> 
		</div>	
		<div class="formBar">
			<ul>
				<li id="delivered"><div class="<c:if test="${comments.state != 0}">buttonDisabled</c:if><c:if test="${comments.state == 0}">buttonActive</c:if>"><div class="buttonContent"><button <c:if test="${comments.state != 0}">disabled="disabled"</c:if> onclick="accept()" type="button">通过</button></div></div></li>
				<li id="delivered"><div class="<c:if test="${comments.state != 0}">buttonDisabled</c:if><c:if test="${comments.state == 0}">buttonActive</c:if>"><div class="buttonContent"><button <c:if test="${comments.state != 0}">disabled="disabled"</c:if> onclick="reject()" type="button">不通过</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>

<script>
function accept(){
	
	alertMsg.confirm("确定要通过该订单吗？", {
		okCall: function(){
			$("#statTxtId").val("审核通过");
			$("#statValueId").val("1");
			$("#acceptId").hide();
			$("#rejectId").hide();
			$("#mainFormId").submit();
		}
	});
}
function reject(){
	alertMsg.confirm("确定要审核不通过该评论吗？", {
		okCall: function(){
			$("#statTxtId").val("审核不通过");
			$("#statValueId").val("2");
			$("#acceptId").hide();
			$("#rejectId").hide();
			$("#mainFormId").submit();
		}
	});
}
</script>